import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';

/**
 * @name Jpush
 */
@Plugin({
  pluginName: 'JPushPlugin',
  plugin: 'jpush-phonegap-plugin', 
  pluginRef: 'JPush', 
  repo: 'https://github.com/jpush/jpush-phonegap-plugin', 
  platforms: ['Android','iOS'],
})
@Injectable()
export class JPushPlugin extends IonicNativePlugin {

// common methods

  @Cordova({sync:true})
  init(): void {}

  @Cordova({sync:true})
  setDebugMode(debug: boolean = true): void {}

  @Cordova()
  getRegistrationID(): Promise<string> { return; }

  @Cordova({sync:true})
  stopPush(): void {}

  @Cordova({sync:true})
  resumePush(): void {}

  @Cordova({sync:true})
  clearLocalNotifications(): void {}

  @Cordova()
  isPushStopped(): Promise<boolean> { return ; }

  @Cordova({sync:true})
  setTagsWithAlias(tags:string[],alias: string): void {}
  
  @Cordova({sync:true})
  setTags(tags:string[]): void {}
  
  @Cordova({sync:true})
  setAlias(alias: string): void {}

  @Cordova()
  getUserNotificationSettings(): Promise<number> {return;}

//ios methods

  @Cordova({sync:true})
  startJpushSDK():void {}

  @Cordova({sync:true})
  setBadge(value: any):void {}

  @Cordova({sync:true})
  resetBadge():void {}

  @Cordova({sync:true})
  setDebugModeFromIos():void {}

  @Cordova({sync:true})
  setLogOFF():void {}

  @Cordova({sync:true})
  setCrashLogON():void {}
  
  @Cordova({sync:true})
  addLocalNotificationForIOS(delayTime:any,content:any, badge:any, notificationId:any,extras:any):void {}

  @Cordova({sync:true})
  deleteLocalNotificationWithIdentifierKeyInIOS(idenifierKey:any):void {}

  @Cordova({sync:true})
  clearAllLocalNotifications():void {}

  @Cordova({sync:true})
  setLocation(latitude:any,longitude:any):void {}

  @Cordova({sync:true})
  startLogPageView(pageName:any):void {}

  @Cordova({sync:true})
  stopLogPageView(pageName:any):void {}

  @Cordova({sync:true})
  beginLogPageView(pageName:any,duration:number):void {}

  @Cordova({sync:true})
  setApplicationIconBadgeNumber(badge:any):void {}

  @Cordova({sync:true})
  getApplicationIconBadgeNumber(callback:any):void {}

  @Cordova({sync:true})
  addDismissActions(actions:any, catgoryId:any):void {}

  @Cordova({sync:true})
  addNotificationActions(actions:any, catgoryId:any):void {}

// Android methods

  @Cordova({sync:true})
  setBasicPushNotificationBuilder():void {}

  @Cordova({sync:true})
  setCustomPushNotificationBuilder():void {}

  @Cordova({sync:true})
  receiveRegistrationIdInAndroidCallback(data:any):void {}

  @Cordova({sync:true})
  receiveMessageInAndroidCallback(data:any):void {}

  @Cordova({sync:true})
  openNotificationInAndroidCallback(data:any):void {}

  @Cordova({sync:true})
  receiveNotificationInAndroidCallback(data:any):void {}

  @Cordova({sync:true})
  clearAllNotification():void {}

  @Cordova({sync:true})
  clearNotificationById():void {}

  @Cordova({sync:true})
  setLatestNotificationNum(num:number):void {}

  @Cordova({sync:true})
  addLocalNotification(builderId:any, content:any, title:string, notificationID:any, broadcastTime:any, extras:any):void {}

  @Cordova({sync:true})
  removeLocalNotification(notificationID:any):void {}

  @Cordova({sync:true})
  reportNotificationOpened(msgId:any):void {}

  @Cordova({sync:true})
  setStatisticsOpen(mode:boolean):void {}

  @Cordova({sync:true})
  requestPermission():void {}

  @Cordova({sync:true})
  setSilenceTime(startHour:number, startMinute:number, endHour:number, endMinute:number):void {}

  @Cordova({sync:true})
  setPushTime(weekdays:number, startHour:number, endHour:number):void {}

}